﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CDOP.Model;

namespace CDOP.Charts
{
    public partial class ByGenderForLocalAuthority : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                if (Session["LoggedUser"] == null)
                    Response.Redirect("../Login.aspx");
        }

        protected void DdLocalAuthoritySelectedIndexChanged(object sender, EventArgs e)
        {
            var dataRef = Chart.GetDeathsByGenderForLocalAuthority(ddLocalAuthority.SelectedValue);
            ChartColumn.Series["SeriesData"].Points.DataBindXY(dataRef, "Gender", dataRef, "Count");
            grdData.DataSource = dataRef;
            grdData.DataBind();
        }
    }
}